Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solve how can I config root_path dynamically? #4968 #5081

Merged
merged 6 commits into from
Aug 3, 2023

Conversation

eastonsuo
Copy link
Contributor

Description

Please include a concise summary, in clear English, of the changes in this pull request. If it closes an issue, please mention it here.

Closes: #(issue)

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Tests

  1. PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests: bash scripts/run_all_tests.sh

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh

@vercel
Copy link

vercel bot commented Aug 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
gradio ✅ Ready (Inspect) Visit Preview Aug 3, 2023 8:10pm

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Aug 3, 2023

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
gradio minor
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

solve how can I config root_path dynamically? #4968

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Aug 3, 2023

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-5081-all-demos


You can install the changes in this PR by running:

pip install https://gradio-builds.s3.amazonaws.com/6be9048ffc8692c7a8f589745345252532ed3468/gradio-3.39.0-py3-none-any.whl

@abidlabs
Copy link
Member

abidlabs commented Aug 3, 2023

This environmental variable looks good @eastonsuo but I would just make the change directly in blocks.py. Let me push the change here

@abidlabs
Copy link
Member

abidlabs commented Aug 3, 2023

Should be fixed now @eastonsuo. I confirmed that setting the GRADIO_ROOT_PATH environmental variable sets the default root path, but it can be overridden by the explicit root_path parameter in launch().

Test code:

import gradio as gr
import os

os.environ["GRADIO_ROOT_PATH"] = "/test"

gr.Interface(lambda x:x, "textbox", "textbox").launch(root_path="")

You can try out this branch by installing pip install https://gradio-builds.s3.amazonaws.com/e91525abc3076a91660643e3cf0a1cec15a3ec5e/gradio-3.39.0-py3-none-any.whl

Will merge in once CI passes.

@abidlabs abidlabs merged commit d7f8382 into gradio-app:main Aug 3, 2023
@pngwn pngwn mentioned this pull request Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants